home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / hsrc_117.zip / INFO.C < prev    next >
Text File  |  1990-11-09  |  6KB  |  172 lines

  1. #include "msgg.h"
  2. #include "twindow.h"
  3. #include "keys.h"
  4. #include "headedit.h"
  5.  
  6. /* Info main command; performs various informative functions, gives
  7.    copyright info, general help, etc. */
  8.  
  9. extern WINDOW *ewnd;
  10.  
  11.  
  12. void pascal info (void) {
  13.  
  14.     int returncode;
  15.     struct ffblk f;
  16.     struct ffblk f1;
  17.     char temp[91];
  18.     char counter;
  19.     word x;
  20.     word y;
  21.     word total;
  22.     long inttotal;
  23.     long prevtotal;
  24.     WINDOW *wnd;
  25.  
  26. Over:
  27.     wnd=establish_window(2,maxy-7,25,69);
  28.     set_help("infof1    ",18,0);
  29.     set_border(wnd,3);
  30.     set_title(wnd," Quick Information on HeadEdit ");
  31.     set_colors(wnd,BORDER,7,0,0);
  32.     display_window(wnd);
  33.     wcursor(wnd,0,0);
  34. Again:
  35.     wprintf(wnd,"\n  HeadEdit is a message reader for the XBBS(no tm) message base.");
  36.     wprintf(wnd,"\n  XST version 1.9 or higher is needed for FIDO(tm) net/echo mail.");
  37.     wprintf(wnd,"\n\t\t  A FidoNet compatible mailer is also required");
  38.     wprintf(wnd,"\n\t\t[FIDO (c) Tom Jennings   XST (c) Wayne Michaels]");
  39.     wprintf(wnd,"\n Compiled: %s  %s [XBBS (c) M. Kimes (1:380/16)]",__DATE__,__TIME__);
  40.     wprintf(wnd,"\n\n  Memory remaining: %lu bytes",coreleft());
  41.     wprintf(wnd,"\n  Line pointers: %u",maxlines);
  42.     wprintf(wnd,"\n  Current Message Directory:\n %s",path);
  43.     if (!nidxsize) wprintf(wnd,"\n No nodelist in use\n");
  44.     else {
  45.         wprintf(wnd,"\n  %lu Nodes listed in nodelist",nidxsize);
  46.         if (*nodepath) wprintf(wnd," in path:\n %s",nodepath);
  47.         sprintf(temp,"%sFidoUser.IDX",nodepath);
  48.         if (!findfirst(temp,&f,0)) wprintf(wnd,"\n  Indexed");
  49.         else wprintf(wnd,"\n  Unindexed");
  50.         sprintf(temp,"%sFidoUser.LST",nodepath);
  51.         if (findfirst(temp,&f,0)) wprintf(wnd," No ");
  52.         wprintf(wnd," FidoUser.Lst is available");
  53.     }
  54.     wprintf(wnd,"\n\n  Current area attributes: %s (%u)\n\n ",area_attr(),currarea->attr);
  55.     if (currarea->attr & NOORIG) wprintf(wnd,"NoOrigins ");
  56.     if (currarea->attr & ANSI) wprintf(wnd,"ANSI ");
  57.     if (currarea->attr & PRIVATE) wprintf(wnd,"Private ");
  58.     if (currarea->attr & PUBLIC) wprintf(wnd,"Public ");
  59.     if (currarea->attr & ECHO) wprintf(wnd,"Echo ");
  60.     if (currarea->attr & NET) wprintf(wnd,"Net");
  61.     wprintf(wnd,"\n ");
  62.     if (currarea->attr & MCI) wprintf(wnd,"MCI ");
  63.     if (currarea->attr & READONLY) wprintf(wnd,"ReadOnly ");
  64.     if (currarea->attr & ALTERNATE) wprintf(wnd,"Alternate ");
  65.     if (currarea->attr & ALTECHO) wprintf(wnd,"Alt Echo ");
  66.     if (currarea->attr & ANON) wprintf(wnd,"Anonymous ");
  67.     if (currarea->attr & REAL) wprintf(wnd,"Real");
  68.     wprintf(wnd,"\n ");
  69.     if(currarea->attr & EXTERN) wprintf(wnd,"Extern ");
  70.     if(currarea->attr & FORCE) wprintf(wnd,"Force ");
  71.     if(currarea->attr & ASSOC) wprintf(wnd,"Assoc ");
  72.     if(currarea->attr & COMPRESS) wprintf(wnd,"CompOK");
  73.     wprintf(wnd,"\n");
  74.     if(currarea->thisname) wprintf(wnd,"  Area alias: \"%s\"",alias[(currarea->thisname)-1]);
  75.     wprintf(wnd,"\n");
  76.     if(currarea->thisaddr) wprintf(wnd,"  Area addr: %u:%u/%01u.%01u@%s"
  77.         ,address[(currarea->thisaddr)-1]->zone,address[(currarea->thisaddr)-1]->net,address[(currarea->thisaddr)-1]->node,address[(currarea->thisaddr)-1]->point,address[(currarea->thisaddr)-1]->domain);
  78. ReMsg:
  79.     any_message(" F1, F2, F3 or Any Key ");
  80.     returncode=generic_mouse_input(ewnd);
  81.     clear_message();
  82.     if(returncode=='1') {
  83.         if (helpfunc) {
  84.             if (!helping) {
  85.                 helping=1;
  86.                 (*helpfunc)();
  87.                 helping=0;
  88.             }
  89.         }
  90.         goto ReMsg;
  91.     }
  92.     delete_window(wnd);
  93.     if(returncode==F2 || returncode==PGUP || returncode=='2') {
  94.         wnd=establish_window(1,1,maxy-1,maxx-1);
  95.         set_help("infof2    ",18,0);
  96.         set_border(wnd,3);
  97.         set_title(wnd," ALT-FKeys ");
  98.         set_colors(wnd,BORDER,7,0,0);
  99.         display_window(wnd);
  100.         wcursor(wnd,0,0);
  101.         for(x=0;x<10;x++) {
  102.             if(fkey[x]) wprintf(wnd,"%02u. %s\n",x+1,fkey[x]);
  103.         }
  104.         any_message(" Any key ");
  105.         pause();
  106.         delete_window(wnd);
  107.         goto Over;
  108.     }
  109.     else if(returncode==F3 || returncode==PGDN || returncode=='3') {
  110.         inttotal=prevtotal=0;
  111.         total=0;
  112.         wnd=establish_window(1,1,maxy-1,maxx-1);
  113.         set_help("infof3    ",18,0);
  114.         set_border(wnd,3);
  115.         set_title(wnd," Msg Area Analysis ");
  116.         set_colors(wnd,BORDER,7,0,0);
  117.         display_window(wnd);
  118.         wcursor(wnd,0,0);
  119.         sprintf(temp,"%sXDATA.*",path);
  120.         if(findfirst(temp,&f1,0)) {
  121.             any_message("No message areas");
  122.             nopause();
  123.             delete_window(wnd);
  124.             goto Over;
  125.         }
  126.         counter=0;
  127.         while (1) {
  128.             sscanf(&f1.ff_name[strlen(f1.ff_name)-3],"%x",&x);
  129.             wprintf(wnd,"Area #%04u: %s: %lu bytes (%lu msgs)",x,f1.ff_name,f1.ff_fsize,f1.ff_fsize/(long)sizeof(struct _xmsg));
  130.             for(y=0;y<maxareas;y++) {
  131.                 if (marea[y].number==x) {
  132.                     wprintf(wnd," [%1.12s]",marea[y].name);
  133.                     goto SkipIt;
  134.                 }
  135.             }
  136.             wprintf(wnd," [Not in MSGAREAS.XBS]");
  137. SkipIt:
  138.             inttotal+=f1.ff_fsize;
  139.             sprintf(temp,"%sXTEXT.%03x",path,x);
  140.             if(!findfirst(temp,&f,0)) {
  141.                 wprintf(wnd,"\n            %s: %lu bytes\n",f.ff_name,f.ff_fsize);
  142.                 inttotal+=f.ff_fsize;
  143.             }
  144.             else wprintf(wnd,"\n            Missing XTEXT\n");
  145.             sprintf(temp,"%sMDUPS.%03x",path,x);
  146.             if(!findfirst(temp,&f,0)) {
  147.                 wprintf(wnd,"            %s: %lu bytes\n",f.ff_name,f.ff_fsize);
  148.                 inttotal+=f.ff_fsize;
  149.             }
  150.             else wprintf(wnd,"           Missing MDUPS\n");
  151.             wprintf(wnd,"Total size area #%04u: %lu bytes",x,inttotal-prevtotal);
  152.             prevtotal=inttotal;
  153.             total++;
  154.             if(findnext(&f1)) break;
  155.             if(++counter>=((maxy-2)/4)) {
  156.                 counter=0;
  157.                 any_message(" More? (Y-n) ");
  158.                 returncode=toupper(generic_mouse_input(ewnd));
  159.                 if(returncode==ESC || returncode=='N') break;
  160.                 clear_message();
  161.             }
  162.             wprintf(wnd,"\n");
  163.         }
  164.         sprintf(temp,"%u message areas occupy %lu bytes",total,inttotal);
  165.         any_message(temp);
  166.         pause();
  167.         delete_window(wnd);
  168.         goto Over;
  169.     }
  170. }
  171.  
  172.